all:
	@clear
	@cat LICENSE
	@echo "your make target choices are"
	@echo " make commercial"
	@echo " make gpl"
	@echo ""
	@echo "or to list all make targets type"
	@echo " make help"

commercial:
	@echo "<?php" > ps-metabase-lib.php
	@echo "/**" >> ps-metabase-lib.php
	@echo "* MetaBase software is commercially licensed" >> ps-metabase-lib.php
	@echo "* visit http://www.pronique.com/software/metabase" >> ps-metabase-lib.php
	@echo "* for licensing information" >> ps-metabase-lib.php
	@echo "*/" >> ps-metabase-lib.php
	@cat source/_CONSTANT_DEF >> ps-metabase-lib.php
	@echo "?>" >> ps-metabase-lib.php
	@cat source/ps_MetaBase.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_iDriver.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_Driver.php >> ps-metabase-lib.php
	@cat source/drivers/ps_MetaBase_Driver_Filesystem.php >> ps-metabase-lib.php
	@cat source/drivers/ps_MetaBase_Driver_BigFilesystem.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_Filter.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_iFilter.php >> ps-metabase-lib.php
	@cat source/filters/ps_MetaBase_Filter_Mock.php >> ps-metabase-lib.php
	@echo "ps-metabase-lib.php built successfully"

gpl:
	@echo "<?php" > ps-metabase-lib.php
	@echo "/**" >> ps-metabase-lib.php
	@echo "* This version of MetaBase software is licensed GPL v3" >> ps-metabase-lib.php
	@echo "* visit http://www.pronique.com/software/metabase" >> ps-metabase-lib.php
	@echo "* for licensing information" >> ps-metabase-lib.php
	@echo "*/" >> ps-metabase-lib.php
	@cat source/_CONSTANT_DEF >> ps-metabase-lib.php
	@echo "?>" >> ps-metabase-lib.php
	@cat source/ps_MetaBase.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_iDriver.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_Driver.php >> ps-metabase-lib.php
	@cat source/drivers/ps_MetaBase_Driver_Filesystem.php >> ps-metabase-lib.php
	@cat source/drivers/ps_MetaBase_Driver_BigFilesystem.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_Filter.php >> ps-metabase-lib.php
	@cat source/ps_MetaBase_iFilter.php >> ps-metabase-lib.php
	@cat source/filters/ps_MetaBase_Filter_Mock.php >> ps-metabase-lib.php
	@echo "ps-metabase-lib.php built successfully"

clean: 

	@rm -f ps-metabase-lib.php
unittest:
	#@if [ ! -d  ./vendor/simpletest ] ; then \
	#	echo "Run get_simpletest.sh first"; \
	#fi
	#	@php ./test/ps_MetaBase_Driver_test.php; 
	#	@php ./test/ps_MetaBase_test.php; 
	@echo ""
	@echo "Fudge, you'll have to run them by hand for now.  There in the test directory"
	@echo ""
lint:
	@php -l source/ps_MetaBase.php
	@php -l source/ps_MetaBase_iDriver.php
	@php -l source/ps_MetaBase_Driver.php
	@php -l source/drivers/ps_MetaBase_Driver_Filesystem.php
	@php -l source/drivers/ps_MetaBase_Driver_BigFilesystem.php
	@php -l source/ps_MetaBase_Filter.php
	@php -l source/ps_MetaBase_iFilter.php
	@php -l source/filters/ps_MetaBase_Filter_Mock.php

help:
	@echo "make gpl"
	@echo "make commercial"
	@echo "make clean"
	@echo "make unittest"
	@echo "make lint"
	@echo "make help"
